package Stream.中间操作符;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class sorted {
    public static void main(String[] args) {

        List<String> strings = Arrays.asList("a","e","b","x");
        System.out.println(strings.stream().sorted().collect(Collectors.toList()));
        System.out.println("*******************************");
        List<Integer> integers = Arrays.asList(1,45,2,-1,232,4);
        // 默认排序，从小到大
        System.out.println(integers.stream().sorted().collect(Collectors.toList()));

    }
}
